export default function useConfig() {
  const { allRegionOptions } = useRegions()

  const tableColumns = buildColumns([
    {
      title: '分组名称',
      dataIndex: 'name',
      format: 'copy',
    },
    {
      title: '所属区域',
      dataIndex: 'region_name',
      render({ record }) {
        return getOptionLabel(record.region_id, allRegionOptions.value)
      },
    },
    {
      title: '关联节点',
      dataIndex: 'instance_num',
    },
    {
      title: '状态',
      dataIndex: 'status',
      slotName: 'status',
    },
    {
      title: '创建时间',
      dataIndex: 'created_at',
      format: 'date-time',
      sortable: sortableSettings,
    },
    {
      title: '操作',
      cellClass: 'actions-cell',
      width: 90,
      slotName: 'actions',
    },
  ])

  return {
    tableColumns,
    allRegionOptions,
  }
}
